import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/LoginView.vue'),
    meta: { title: '登录' }
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('../views/RegisterView.vue'),
    meta: { title: '注册' }
  },
  {
    path: '/dashboard',
    name: 'Dashboard',
    component: () => import('../views/DashboardView.vue'),
    meta: { title: '管理系统', requiresAuth: true },
    children: [
      {
        path: '',
        name: 'Home',
        component: () => import('../views/dashboard/HomeView.vue'),
        meta: { title: '首页' }
      },
      {
        path: 'orders',
        name: 'Orders',
        component: () => import('../views/dashboard/OrdersView.vue'),
        meta: { title: '订单管理' }
      },
      {
        path: 'users',
        name: 'Users',
        component: () => import('../views/dashboard/UsersView.vue'),
        meta: { title: '用户管理' }
      },
      {
        path: 'roles',
        name: 'Roles',
        component: () => import('../views/dashboard/RolesView.vue'),
        meta: { title: '角色管理' }
      },
      {
        path: 'categories',
        name: 'Categories',
        component: () => import('../views/dashboard/CategoriesView.vue'),
        meta: { title: '分类管理' }
      },
      {
        path: 'dishes',
        name: 'Dishes',
        component: () => import('../views/dashboard/DishesView.vue'),
        meta: { title: '菜品管理' }
      },
      {
        path: 'revenue-analysis',
        name: 'RevenueAnalysis',
        component: () => import('../views/dashboard/RevenueAnalysisView.vue'),
        meta: { title: '收益分析' }
      },
      {
        path: 'members',
        name: 'Members',
        component: () => import('../views/dashboard/MembersView.vue'),
        meta: { title: '会员管理' }
      },
      {
        path: 'store-name',
        name: 'StoreName',
        component: () => import('../views/dashboard/StoreNameView.vue'),
        meta: { title: '本店名称' }
      },
      {
        path: 'wifi-settings',
        name: 'WifiSettings',
        component: () => import('../views/dashboard/WifiSettingsView.vue'),
        meta: { title: '店内WiFi' }
      }
    ]
  }
]

export default routes 